#!/bin/sh
user=fujieda
host=$1
shift
sln=DynaJson
bench=Benchmark
publish=$bench/bin/Release/netcoreapp3.1/publish
libs="DynaJson DynamicJson"
results=$publish/BenchmarkDotNet.Artifacts
top=/mnt/$sln
ssh $host sudo sh -c "'if [ ! -d $top ]; then mkdir $top; chown -R $user $top; fi'"
rsync -rtv --exclude BenchmarkDotNet.Artifacts $bench $libs $sln.sln $host:/mnt/$sln
ssh $host sudo sh -c "'cd /mnt/$sln/$publish; dotnet $bench.dll $@'"
rsync -rtv $host:/mnt/$sln/$results/ $results
